//
//  HMOAuthControllerModel.swift
//  HMSlender
//
//  Created by 赵少朋赵少朋 on 17/1/23.
//  Copyright © 2017年 ITheima. All rights reserved.
//

import UIKit
import YYModel

class HMOAuthControllerModel: NSObject, NSCoding {

    var access_token: String?
    var expires_in: Double = 0 {
    
        didSet {
            expires_Date = Date(timeIntervalSinceNow: expires_in)
        }
    }
    var uid: String?
    var screen_name: String?
    var avatar_large: String?
    var expires_Date: Date?
    
    override init() {
        super.init()
    }
    
    func encode(with aCoder: NSCoder) {
        self.yy_modelEncode(with: aCoder)
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init()
        self.yy_modelInit(with: aDecoder)
    }
    
    
    override var description: String {
    
        let keys = ["access_token", "expires_in", "uid", "screen_name", "avatar_large","expires_Date"]
        return dictionaryWithValues(forKeys: keys).description
    }
    
    
    
}
